<template>
    <i class="iconfont icon-television" z-index="2" @click="click" style="font-size: 20px;"></i>
</template>

<script>
  import screenfull from 'screenfull'

  export default {
    name: 'Screenfull',
    props: {
      width: {
        type: Number,
        default: 15
      },
      height: {
        type: Number,
        default: 15
      },
      fill: {
        type: String,
        default: '#48576a'
      }
    },
    data () {
      return {
        isFullscreen: false
      }
    },
    methods: {
      click () {
        if (!screenfull.enabled) {
          this.$message({
            message: '您的浏览器不支持此操作。',
            type: 'warning'
          })
          return false
        }
        screenfull.toggle()
      }
    }
  }
</script>

<style scoped>
  .size-icon {
    width: 28px;
    height: 28px;
  }
</style>
